package cn.tedu.tmall.front.mall.service.impl;

import cn.tedu.tmall.common.pojo.vo.PageData;
import cn.tedu.tmall.front.mall.dao.cache.IGoodsCacheRepository;
import cn.tedu.tmall.front.mall.dao.cache.impl.GoodsCacheRepository;
import cn.tedu.tmall.front.mall.dao.persist.repository.IGoodsRepository;
import cn.tedu.tmall.front.mall.dao.persist.repository.impl.GoodsRepository;
import cn.tedu.tmall.front.mall.pojo.vo.GoodsListItemVO;
import cn.tedu.tmall.front.mall.service.IGoodsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class GoodsService implements IGoodsService {
    @Autowired
    IGoodsRepository repository;
    @Autowired
    IGoodsCacheRepository goodsCacheRepository;
    @Override
    public PageData<GoodsListItemVO> listByRecommend(Integer pageNum, Integer pageSize) {
        return repository.listByRecommend(pageNum,pageSize);
    }

    @Override
    public PageData<GoodsListItemVO> listByCategory(Long categoryId, Integer pageNum, Integer pageSize) {
        return repository.listByCategory(categoryId, pageNum, pageSize);
    }

}
